using Cassette.Configuration;
using Cassette.Scripts;
using Cassette.Stylesheets;
using Cassette.BundleProcessing;

namespace TestFAjax
{
	/// <summary>
	/// Configures the Cassette asset modules for the web application.
	/// </summary>
	public class CassetteConfiguration : ICassetteConfiguration
	{
		public void Configure(BundleCollection bundles, CassetteSettings settings)
		{
			settings.IsDebuggingEnabled = true;

			// TODO: Configure your bundles here...
			// Please read http://getcassette.net/documentation/configuration

			// This default configuration treats each file as a separate 'bundle'.
			// In production the content will be minified, but the files are not combined.
			// So you probably want to tweak these defaults!
			if (settings.IsDebuggingEnabled)
			{
				bundles.AddPerIndividualFile<StylesheetBundle>("Content/Css");
				bundles.AddPerIndividualFile<ScriptBundle>("Content/Scripts");

			}
			else
			{
		  //      bundles.AddUrlWithLocalAssets(
		  //        "//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js",
		  //new LocalAssetSettings
		  //{
		  //    // Local assets for use in debug mode.
		  //    Path = "Scripts/jquery-1.7.1.js",
		  //    // When condition is true, uses the local assets
		  //    FallbackCondition = "!window.jQuery"
		  //});
				bundles.AddPerIndividualFile<StylesheetBundle>("Content/Css");
				bundles.AddPerIndividualFile<ScriptBundle>("Content/Scripts");
				//bundles.Add<ScriptBundle>("Content/Scripts", b => b.Processor = new ScriptPipeline().Remove<MinifyAssets>());
				//bundles.Add<StylesheetBundle>("Content/Css");
				//bundles.Add<ScriptBundle>("Content/Scripts");
				//bundles.Add<ScriptBundle>("Content/Scripts/jQuery");
				//bundles.AddPerSubDirectory<ScriptBundle>("Content/Scripts");

				//bundles.Add<ScriptBundle>("Scripts", b => b.Processor = new ScriptPipeline().Remove<MinifyAssets>());
			}


			//Bbundles.AddPerIndividualFile<ScriptBundle>("Scripts/Cards");

			// To combine files, try something like this instead:
			//bundles.Add<StylesheetBundle>("Content");
			//bundles.Add<ScriptBundle>("Scripts");
			//In production mode, all of ~/Content will be combined into a single bundle.

			// If you want a bundle per folder, try this:
			//bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
			// Each immediate sub-directory of ~/Scripts will be combined into its own bundle.
			// This is useful when there are lots of scripts for different areas of the website.

			// *** TOP TIP: Delete all ".min.js" files now ***
			// Cassette minifies scripts for you. So those files are never used.
		}
	}
}